/*
 * SpriteComponent.h
 *
 *  Created on: May 13, 2012
 *      Author: mklingen
 */

#ifndef SPRITECOMPONENT_H
#define SPRITECOMPONENT_H

#include "GameComponent.h"
#include "../ResourceManagement/ImageResource.h"
#include "GameComponentDefs.h"
#include "GameComponentManager.h"

namespace kling
{

    class GameComponentManager;

    class SpriteComponent: public GameComponent
    {
        public:
            SpriteComponent(std::string fileName, kling::GameComponentManager* componentManager, std::string name = "Sprite", GlobalComponentID id = INVALID_GLOBAL_ID);
            virtual ~SpriteComponent();

            inline sf::Sprite* GetSprite() { return m_sprite; }
            inline ImageResource* GetResource() { return m_imageResource;}

            virtual void Update(double dt);
            virtual void Render(double dt);
            virtual void Initialize();

        protected:
            ImageResource* m_imageResource;
            sf::Sprite* m_sprite;
    };

} /* namespace kling */
#endif /* SPRITECOMPONENT_H_ */
